<?php


abstract class BaseHorarioCambio extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $usuario_id;


	
	protected $reemplazo_id;


	
	protected $dia_id;


	
	protected $fecha_inicio;


	
	protected $fecha_fin;


	
	protected $tipo_id;


	
	protected $activo = 1;


	
	protected $created_by;


	
	protected $update_by;


	
	protected $updated_fields;


	
	protected $id;

	
	protected $aUsuarioRelatedByUsuarioId;

	
	protected $aUsuarioRelatedByReemplazoId;

	
	protected $aDia;

	
	protected $aHorarioCambioTipo;

	
	protected $aUsuarioRelatedByCreatedBy;

	
	protected $aUsuarioRelatedByUpdateBy;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getUsuarioId()
	{

		return $this->usuario_id;
	}

	
	public function getReemplazoId()
	{

		return $this->reemplazo_id;
	}

	
	public function getDiaId()
	{

		return $this->dia_id;
	}

	
	public function getFechaInicio($format = 'Y-m-d H:i:s')
	{

		if ($this->fecha_inicio === null || $this->fecha_inicio === '') {
			return null;
		} elseif (!is_int($this->fecha_inicio)) {
						$ts = strtotime($this->fecha_inicio);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [fecha_inicio] as date/time value: " . var_export($this->fecha_inicio, true));
			}
		} else {
			$ts = $this->fecha_inicio;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getFechaFin($format = 'Y-m-d H:i:s')
	{

		if ($this->fecha_fin === null || $this->fecha_fin === '') {
			return null;
		} elseif (!is_int($this->fecha_fin)) {
						$ts = strtotime($this->fecha_fin);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [fecha_fin] as date/time value: " . var_export($this->fecha_fin, true));
			}
		} else {
			$ts = $this->fecha_fin;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getTipoId()
	{

		return $this->tipo_id;
	}

	
	public function getActivo()
	{

		return $this->activo;
	}

	
	public function getCreatedBy()
	{

		return $this->created_by;
	}

	
	public function getUpdateBy()
	{

		return $this->update_by;
	}

	
	public function getUpdatedFields()
	{

		return $this->updated_fields;
	}

	
	public function getId()
	{

		return $this->id;
	}

	
	public function setUsuarioId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->usuario_id !== $v) {
			$this->usuario_id = $v;
			$this->modifiedColumns[] = HorarioCambioPeer::USUARIO_ID;
		}

		if ($this->aUsuarioRelatedByUsuarioId !== null && $this->aUsuarioRelatedByUsuarioId->getId() !== $v) {
			$this->aUsuarioRelatedByUsuarioId = null;
		}

	} 
	
	public function setReemplazoId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->reemplazo_id !== $v) {
			$this->reemplazo_id = $v;
			$this->modifiedColumns[] = HorarioCambioPeer::REEMPLAZO_ID;
		}

		if ($this->aUsuarioRelatedByReemplazoId !== null && $this->aUsuarioRelatedByReemplazoId->getId() !== $v) {
			$this->aUsuarioRelatedByReemplazoId = null;
		}

	} 
	
	public function setDiaId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->dia_id !== $v) {
			$this->dia_id = $v;
			$this->modifiedColumns[] = HorarioCambioPeer::DIA_ID;
		}

		if ($this->aDia !== null && $this->aDia->getId() !== $v) {
			$this->aDia = null;
		}

	} 
	
	public function setFechaInicio($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [fecha_inicio] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->fecha_inicio !== $ts) {
			$this->fecha_inicio = $ts;
			$this->modifiedColumns[] = HorarioCambioPeer::FECHA_INICIO;
		}

	} 
	
	public function setFechaFin($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [fecha_fin] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->fecha_fin !== $ts) {
			$this->fecha_fin = $ts;
			$this->modifiedColumns[] = HorarioCambioPeer::FECHA_FIN;
		}

	} 
	
	public function setTipoId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->tipo_id !== $v) {
			$this->tipo_id = $v;
			$this->modifiedColumns[] = HorarioCambioPeer::TIPO_ID;
		}

		if ($this->aHorarioCambioTipo !== null && $this->aHorarioCambioTipo->getId() !== $v) {
			$this->aHorarioCambioTipo = null;
		}

	} 
	
	public function setActivo($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->activo !== $v || $v === 1) {
			$this->activo = $v;
			$this->modifiedColumns[] = HorarioCambioPeer::ACTIVO;
		}

	} 
	
	public function setCreatedBy($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->created_by !== $v) {
			$this->created_by = $v;
			$this->modifiedColumns[] = HorarioCambioPeer::CREATED_BY;
		}

		if ($this->aUsuarioRelatedByCreatedBy !== null && $this->aUsuarioRelatedByCreatedBy->getId() !== $v) {
			$this->aUsuarioRelatedByCreatedBy = null;
		}

	} 
	
	public function setUpdateBy($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->update_by !== $v) {
			$this->update_by = $v;
			$this->modifiedColumns[] = HorarioCambioPeer::UPDATE_BY;
		}

		if ($this->aUsuarioRelatedByUpdateBy !== null && $this->aUsuarioRelatedByUpdateBy->getId() !== $v) {
			$this->aUsuarioRelatedByUpdateBy = null;
		}

	} 
	
	public function setUpdatedFields($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->updated_fields !== $v) {
			$this->updated_fields = $v;
			$this->modifiedColumns[] = HorarioCambioPeer::UPDATED_FIELDS;
		}

	} 
	
	public function setId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = HorarioCambioPeer::ID;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->usuario_id = $rs->getInt($startcol + 0);

			$this->reemplazo_id = $rs->getInt($startcol + 1);

			$this->dia_id = $rs->getInt($startcol + 2);

			$this->fecha_inicio = $rs->getTimestamp($startcol + 3, null);

			$this->fecha_fin = $rs->getTimestamp($startcol + 4, null);

			$this->tipo_id = $rs->getInt($startcol + 5);

			$this->activo = $rs->getInt($startcol + 6);

			$this->created_by = $rs->getInt($startcol + 7);

			$this->update_by = $rs->getInt($startcol + 8);

			$this->updated_fields = $rs->get($startcol + 9);

			$this->id = $rs->getInt($startcol + 10);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 11; 
		} catch (Exception $e) {
			throw new PropelException("Error populating HorarioCambio object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(HorarioCambioPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			HorarioCambioPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(HorarioCambioPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


												
			if ($this->aUsuarioRelatedByUsuarioId !== null) {
				if ($this->aUsuarioRelatedByUsuarioId->isModified()) {
					$affectedRows += $this->aUsuarioRelatedByUsuarioId->save($con);
				}
				$this->setUsuarioRelatedByUsuarioId($this->aUsuarioRelatedByUsuarioId);
			}

			if ($this->aUsuarioRelatedByReemplazoId !== null) {
				if ($this->aUsuarioRelatedByReemplazoId->isModified()) {
					$affectedRows += $this->aUsuarioRelatedByReemplazoId->save($con);
				}
				$this->setUsuarioRelatedByReemplazoId($this->aUsuarioRelatedByReemplazoId);
			}

			if ($this->aDia !== null) {
				if ($this->aDia->isModified()) {
					$affectedRows += $this->aDia->save($con);
				}
				$this->setDia($this->aDia);
			}

			if ($this->aHorarioCambioTipo !== null) {
				if ($this->aHorarioCambioTipo->isModified()) {
					$affectedRows += $this->aHorarioCambioTipo->save($con);
				}
				$this->setHorarioCambioTipo($this->aHorarioCambioTipo);
			}

			if ($this->aUsuarioRelatedByCreatedBy !== null) {
				if ($this->aUsuarioRelatedByCreatedBy->isModified()) {
					$affectedRows += $this->aUsuarioRelatedByCreatedBy->save($con);
				}
				$this->setUsuarioRelatedByCreatedBy($this->aUsuarioRelatedByCreatedBy);
			}

			if ($this->aUsuarioRelatedByUpdateBy !== null) {
				if ($this->aUsuarioRelatedByUpdateBy->isModified()) {
					$affectedRows += $this->aUsuarioRelatedByUpdateBy->save($con);
				}
				$this->setUsuarioRelatedByUpdateBy($this->aUsuarioRelatedByUpdateBy);
			}


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = HorarioCambioPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += HorarioCambioPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


												
			if ($this->aUsuarioRelatedByUsuarioId !== null) {
				if (!$this->aUsuarioRelatedByUsuarioId->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aUsuarioRelatedByUsuarioId->getValidationFailures());
				}
			}

			if ($this->aUsuarioRelatedByReemplazoId !== null) {
				if (!$this->aUsuarioRelatedByReemplazoId->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aUsuarioRelatedByReemplazoId->getValidationFailures());
				}
			}

			if ($this->aDia !== null) {
				if (!$this->aDia->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aDia->getValidationFailures());
				}
			}

			if ($this->aHorarioCambioTipo !== null) {
				if (!$this->aHorarioCambioTipo->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aHorarioCambioTipo->getValidationFailures());
				}
			}

			if ($this->aUsuarioRelatedByCreatedBy !== null) {
				if (!$this->aUsuarioRelatedByCreatedBy->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aUsuarioRelatedByCreatedBy->getValidationFailures());
				}
			}

			if ($this->aUsuarioRelatedByUpdateBy !== null) {
				if (!$this->aUsuarioRelatedByUpdateBy->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aUsuarioRelatedByUpdateBy->getValidationFailures());
				}
			}


			if (($retval = HorarioCambioPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}



			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = HorarioCambioPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getUsuarioId();
				break;
			case 1:
				return $this->getReemplazoId();
				break;
			case 2:
				return $this->getDiaId();
				break;
			case 3:
				return $this->getFechaInicio();
				break;
			case 4:
				return $this->getFechaFin();
				break;
			case 5:
				return $this->getTipoId();
				break;
			case 6:
				return $this->getActivo();
				break;
			case 7:
				return $this->getCreatedBy();
				break;
			case 8:
				return $this->getUpdateBy();
				break;
			case 9:
				return $this->getUpdatedFields();
				break;
			case 10:
				return $this->getId();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = HorarioCambioPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getUsuarioId(),
			$keys[1] => $this->getReemplazoId(),
			$keys[2] => $this->getDiaId(),
			$keys[3] => $this->getFechaInicio(),
			$keys[4] => $this->getFechaFin(),
			$keys[5] => $this->getTipoId(),
			$keys[6] => $this->getActivo(),
			$keys[7] => $this->getCreatedBy(),
			$keys[8] => $this->getUpdateBy(),
			$keys[9] => $this->getUpdatedFields(),
			$keys[10] => $this->getId(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = HorarioCambioPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setUsuarioId($value);
				break;
			case 1:
				$this->setReemplazoId($value);
				break;
			case 2:
				$this->setDiaId($value);
				break;
			case 3:
				$this->setFechaInicio($value);
				break;
			case 4:
				$this->setFechaFin($value);
				break;
			case 5:
				$this->setTipoId($value);
				break;
			case 6:
				$this->setActivo($value);
				break;
			case 7:
				$this->setCreatedBy($value);
				break;
			case 8:
				$this->setUpdateBy($value);
				break;
			case 9:
				$this->setUpdatedFields($value);
				break;
			case 10:
				$this->setId($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = HorarioCambioPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setUsuarioId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setReemplazoId($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setDiaId($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setFechaInicio($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setFechaFin($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setTipoId($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setActivo($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setCreatedBy($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setUpdateBy($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setUpdatedFields($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setId($arr[$keys[10]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(HorarioCambioPeer::DATABASE_NAME);

		if ($this->isColumnModified(HorarioCambioPeer::USUARIO_ID)) $criteria->add(HorarioCambioPeer::USUARIO_ID, $this->usuario_id);
		if ($this->isColumnModified(HorarioCambioPeer::REEMPLAZO_ID)) $criteria->add(HorarioCambioPeer::REEMPLAZO_ID, $this->reemplazo_id);
		if ($this->isColumnModified(HorarioCambioPeer::DIA_ID)) $criteria->add(HorarioCambioPeer::DIA_ID, $this->dia_id);
		if ($this->isColumnModified(HorarioCambioPeer::FECHA_INICIO)) $criteria->add(HorarioCambioPeer::FECHA_INICIO, $this->fecha_inicio);
		if ($this->isColumnModified(HorarioCambioPeer::FECHA_FIN)) $criteria->add(HorarioCambioPeer::FECHA_FIN, $this->fecha_fin);
		if ($this->isColumnModified(HorarioCambioPeer::TIPO_ID)) $criteria->add(HorarioCambioPeer::TIPO_ID, $this->tipo_id);
		if ($this->isColumnModified(HorarioCambioPeer::ACTIVO)) $criteria->add(HorarioCambioPeer::ACTIVO, $this->activo);
		if ($this->isColumnModified(HorarioCambioPeer::CREATED_BY)) $criteria->add(HorarioCambioPeer::CREATED_BY, $this->created_by);
		if ($this->isColumnModified(HorarioCambioPeer::UPDATE_BY)) $criteria->add(HorarioCambioPeer::UPDATE_BY, $this->update_by);
		if ($this->isColumnModified(HorarioCambioPeer::UPDATED_FIELDS)) $criteria->add(HorarioCambioPeer::UPDATED_FIELDS, $this->updated_fields);
		if ($this->isColumnModified(HorarioCambioPeer::ID)) $criteria->add(HorarioCambioPeer::ID, $this->id);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(HorarioCambioPeer::DATABASE_NAME);

		$criteria->add(HorarioCambioPeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setUsuarioId($this->usuario_id);

		$copyObj->setReemplazoId($this->reemplazo_id);

		$copyObj->setDiaId($this->dia_id);

		$copyObj->setFechaInicio($this->fecha_inicio);

		$copyObj->setFechaFin($this->fecha_fin);

		$copyObj->setTipoId($this->tipo_id);

		$copyObj->setActivo($this->activo);

		$copyObj->setCreatedBy($this->created_by);

		$copyObj->setUpdateBy($this->update_by);

		$copyObj->setUpdatedFields($this->updated_fields);


		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new HorarioCambioPeer();
		}
		return self::$peer;
	}

	
	public function setUsuarioRelatedByUsuarioId($v)
	{


		if ($v === null) {
			$this->setUsuarioId(NULL);
		} else {
			$this->setUsuarioId($v->getId());
		}


		$this->aUsuarioRelatedByUsuarioId = $v;
	}


	
	public function getUsuarioRelatedByUsuarioId($con = null)
	{
		if ($this->aUsuarioRelatedByUsuarioId === null && ($this->usuario_id !== null)) {
						include_once 'lib/model/om/BaseUsuarioPeer.php';

			$this->aUsuarioRelatedByUsuarioId = UsuarioPeer::retrieveByPK($this->usuario_id, $con);

			
		}
		return $this->aUsuarioRelatedByUsuarioId;
	}

	
	public function setUsuarioRelatedByReemplazoId($v)
	{


		if ($v === null) {
			$this->setReemplazoId(NULL);
		} else {
			$this->setReemplazoId($v->getId());
		}


		$this->aUsuarioRelatedByReemplazoId = $v;
	}


	
	public function getUsuarioRelatedByReemplazoId($con = null)
	{
		if ($this->aUsuarioRelatedByReemplazoId === null && ($this->reemplazo_id !== null)) {
						include_once 'lib/model/om/BaseUsuarioPeer.php';

			$this->aUsuarioRelatedByReemplazoId = UsuarioPeer::retrieveByPK($this->reemplazo_id, $con);

			
		}
		return $this->aUsuarioRelatedByReemplazoId;
	}

	
	public function setDia($v)
	{


		if ($v === null) {
			$this->setDiaId(NULL);
		} else {
			$this->setDiaId($v->getId());
		}


		$this->aDia = $v;
	}


	
	public function getDia($con = null)
	{
		if ($this->aDia === null && ($this->dia_id !== null)) {
						include_once 'lib/model/om/BaseDiaPeer.php';

			$this->aDia = DiaPeer::retrieveByPK($this->dia_id, $con);

			
		}
		return $this->aDia;
	}

	
	public function setHorarioCambioTipo($v)
	{


		if ($v === null) {
			$this->setTipoId(NULL);
		} else {
			$this->setTipoId($v->getId());
		}


		$this->aHorarioCambioTipo = $v;
	}


	
	public function getHorarioCambioTipo($con = null)
	{
		if ($this->aHorarioCambioTipo === null && ($this->tipo_id !== null)) {
						include_once 'lib/model/om/BaseHorarioCambioTipoPeer.php';

			$this->aHorarioCambioTipo = HorarioCambioTipoPeer::retrieveByPK($this->tipo_id, $con);

			
		}
		return $this->aHorarioCambioTipo;
	}

	
	public function setUsuarioRelatedByCreatedBy($v)
	{


		if ($v === null) {
			$this->setCreatedBy(NULL);
		} else {
			$this->setCreatedBy($v->getId());
		}


		$this->aUsuarioRelatedByCreatedBy = $v;
	}


	
	public function getUsuarioRelatedByCreatedBy($con = null)
	{
		if ($this->aUsuarioRelatedByCreatedBy === null && ($this->created_by !== null)) {
						include_once 'lib/model/om/BaseUsuarioPeer.php';

			$this->aUsuarioRelatedByCreatedBy = UsuarioPeer::retrieveByPK($this->created_by, $con);

			
		}
		return $this->aUsuarioRelatedByCreatedBy;
	}

	
	public function setUsuarioRelatedByUpdateBy($v)
	{


		if ($v === null) {
			$this->setUpdateBy(NULL);
		} else {
			$this->setUpdateBy($v->getId());
		}


		$this->aUsuarioRelatedByUpdateBy = $v;
	}


	
	public function getUsuarioRelatedByUpdateBy($con = null)
	{
		if ($this->aUsuarioRelatedByUpdateBy === null && ($this->update_by !== null)) {
						include_once 'lib/model/om/BaseUsuarioPeer.php';

			$this->aUsuarioRelatedByUpdateBy = UsuarioPeer::retrieveByPK($this->update_by, $con);

			
		}
		return $this->aUsuarioRelatedByUpdateBy;
	}

} 